<?php

/**
 * @author Rizky Tahara Shita
 * @website http://tahara.web.id
 * @email rizky.tahara@gmail.com
 * @copyright b'IT Cyber Solution
 */

class M_log extends BZ_Model
{
/**
 * @section biskitZ Log Model
 */

	/**
	 * @function write()
	 * @description write the log
	 */
	function write($prm_dbase = 'db_default', $prm_action_note = '')
	{
		if ($this->web_data['BISKITZ']['SETTINGS']['BISKITZ_LOGGING_USE'] == TRUE && $this->session->userdata('session_user_id') != '')
		{
			$module = $this->M_menu->detail($prm_dbase, FALSE);


			$data = array
				(
					'access_time' => date('Y-m-d H:i:s')
					, 'biskitz_user__id' => $this->session->userdata('session_user_id')
					, 'ip_address' => $this->input->ip_address()
					, 'user_agent' => $this->input->user_agent()
					, 'modules__id' => $module['ID']['MODULE']
					, 'menus__id' => $module['ID']['MENU']
					, 'parameters' => uri_string()
					, 'action_note' => $prm_action_note
				);

			$this->M_database->insert($prm_dbase, 'biskitz_logging_log', $data, FALSE, FALSE);
		}
	}



}

/** End of file M_log.php */
/** Location: ./biskitz_mpc/biskitz/models/admin/m_log.php */